//
//  DYRegisterVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/11.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYRegisterVC.h"
#import "DYRegisterView.h"
#import "DYAgreementVC.h"
#import "DYNavigationController.h"


@interface DYRegisterVC ()

@property (nonatomic,strong)DYRegisterView *registerView;

@end

@implementation DYRegisterVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.navigationItem.title=@"手机号注册";
    [self createLeftBarItem:@"nav_back" titleString:nil];
    
    [self.view addSubview:self.registerView];

}
-(void)leftButtonClick
{
    [self dismissViewControllerAnimated:YES completion:nil];
}
-(DYRegisterView *)registerView
{
    if (!_registerView) {
        _registerView=[[DYRegisterView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight-kNavigationStatusHeight)];
        @weakify(self);
        _registerView.registerViewBlock = ^(NSInteger type) {
            @strongify(self);
            if (type==1) {
                [self dismissViewControllerAnimated:YES completion:nil];
            }else if (type==2){
                XHQHUDTEXT(@"注册登录");
            }else{
                DYAgreementVC *vc=[[DYAgreementVC alloc]init];
                vc.navigationItem.title=@"注册协议";
                DYNavigationController *nav=[[DYNavigationController alloc]initWithRootViewController:vc];
                [self presentViewController:nav animated:YES completion:nil];
            }
        };
    }
    return _registerView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
